class CreateDocuments < ActiveRecord::Migration
    def self.up
        create_table :documents do |t|
			t.string :authors
			t.datetime :publication_date
			t.string :related_work
            t.integer :owner_id, null: false
            t.string :created_by, null: false
            t.string :updated_by

            t.timestamps
        end
		
        add_index :documents, :owner_id

		Document.create_translation_table! name: :string, description: :text
    end

    def self.down
		Document.drop_translation_table!
        drop_table :documents
    end
end
